package com.guchenbo.schedule.biz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author guchenbo
 * @date 2021/4/25
 */
public class Demo2QuartzJob extends QuartzJobBean {

  protected static final Logger log = LoggerFactory.getLogger(Demo2QuartzJob.class);

  @Autowired
  private UserMgr userMgr;

  /**
   * Execute the actual job. The job data map will already have been applied as bean property values
   * by execute. The contract is exactly the same as for the standard Quartz execute method.
   *
   * @param context
   * @see #execute
   */
  @Override
  protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
    log.info(userMgr.hello("demo2"));
  }
}
